package com.jblv.frame.user.api.vo;


import com.jblv.frame.common.utils.tree.TreeNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author happyonion.yangtao
 * @version 1.0
 * @title SysDeptDTO
 * @projectName jblv-frame
 * @packageName com.jblv.web.dto
 * @description 部门列表DTO
 * @date Create at 2020/5/26 22:03
 * @since jdk1.8
 */
@ApiModel(value="部门DTO类",description="部门数据传类" )
public class SysDeptListVO implements TreeNode<String>,Serializable {
    private static final long serialVersionUID = -2568783836533671362L;

    /**
     * 部门ID
     */
    @ApiModelProperty(value = "deptId",example="45a4f4f898944d7d952535509095f248")
    private String deptId;
    /**
     * 上级部门ID，一级部门为0
     */
    @ApiModelProperty(example="52ww",required = false)
    private String parentId;

    /**
     * 上级部门名称，一级部门为顶级
     */
    @ApiModelProperty(example="顶级",required = false)
    private String parentName;

    /**
     * 部门名称
     */
    @ApiModelProperty(example="政治部")
    private String name;


    @ApiModelProperty()
    private List<SysDeptListVO> children;

    public SysDeptListVO() {

    }
    public SysDeptListVO(String deptId, String parentId, String name) {
        this.deptId = deptId;
        this.parentId = parentId;
        this.name = name;
    }

    @Override
    public String id() {
        return this.getDeptId();
    }

    @Override
    public Boolean root() {
        return Objects.equals(this.parentId, "0");
    }

    @Override
    public String parentId() {
        return this.getParentId();
    }

    @Override
    public List<SysDeptListVO> getChildren() {
        return children;
    }

    @Override
    public void setChildren(List children) {
        this.children = children;
    }



    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }



}
